package day05;

import org.w3c.dom.ls.LSOutput;

public class MethodDemo {
  //无参无返回值
  /*public static void main(String[] args) {
        say();
        System.out.println("over");
    }
    public static void say(){
        System.out.println("大家好");
    }
}*/
   /* public static void main(String[] args) {

        System.out.println("你也好");
        say();
    }
    public static void say(){
        System.out.println("你好");
    }*/

  public static void say(){
    System.out.println("大家好");
  }
   //有参无返回值
    public static void say(String name){//形参
      System.out.println("大家好我叫"+name+"今年20岁了");
    }
    public static void say(String name,int age){
      if(age>40){
        return;
      }
      System.out.println("大家好我叫"+name+"今年"+age+"岁了");
    }public static void say(int age){}
      public static void say(int age,String name){}
      //public static int  say (){return 1;}编译错误，重载与返回值类型无关
        //public static void say(String address){}编译错误，重载与参数名称无关
    public static void main(String[] args) {

        say();
        say("yss");
        say("yss",30);

      /*sayhi("yss");//实参
      sayhello("cxz",50);//实参
      System.out.println("你好");*/

    }


}
